﻿using System;

namespace Zo.Events
{
    /// <summary>
    /// 事件订阅者。
    /// </summary>
    /// <remarks>
    /// 负责事件处理器的注册与监听事件。
    /// </remarks>
    public interface IEventSubscriber : IDisposable
    {
        /// <summary>
        /// 订阅。
        /// </summary>
        /// <typeparam name="TEvent"></typeparam>
        /// <typeparam name="TEventHandler"></typeparam>
        void Subscribe<TEvent, TEventHandler>()
            where TEvent : class, IEvent
            where TEventHandler : class, IEventHandler<TEvent>;
    }
}